package com.jlu.es.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Document(indexName = "product",shards = 3,replicas = 1)
public class Product {


  @Id
  private Long id;//商品唯一标识

  @Field(type = FieldType.Text)
  private String title;//商品标题

  @Field(type = FieldType.Keyword)
  private String category;//关键字，商品分类

  @Field(type = FieldType.Keyword,index = false)
  private String images;//关键字，图片，不能被拆分

  @Field(type = FieldType.Double)
  private Double price;//价格
}
